
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Abahe
 */
public class HelloCanvas extends Canvas {

    protected void paint(Graphics g) {
        //membuat background putih
        g.setColor(0xffffff); //set warna putih
        g.fillRect(0, 0, getWidth(), getHeight()); //fill layar dgn rectange warna putih

        g.setColor(0x0000ff); //set warna biru
        g.drawString("Hello Canvas! :D", 10, 100,
                Graphics.TOP | Graphics.LEFT); //menampilkan string warna biru di lokasi (10,100)
    }
}
